<template>
    <div>
        这是子页面
        这是父组件传过来的{{a}}
    </div>
</template>

<script lang="ts">
import { defineComponent,inject } from 'vue'
export default defineComponent({
    name:'child',
    setup(props,ctx){
        const a = inject('msg')
        return {a}
    }
})
</script>